package com.kangye.learnstudent.controller;

import com.kangye.learnstudent.service.ClassesService;
import com.kangye.learnstudent.util.ViewJsonObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: learndeduo
 * @description: 班级测试接口
 * @author: 索腾龙
 * @create: 2021-05-17 11:11
 **/
@RestController
@CrossOrigin
@RequestMapping("/classes")
public class ClassesController {
    //注入service层
    @Autowired
    private ClassesService classesService;

    /**
     * 获取全部年级
     *  @RequestMapping(value = "/getclassAll",method = RequestMethod.GEL) 设置虚拟路径 GET提交方式
     * @return
     */
    @RequestMapping(value = "/getClassAll",method = RequestMethod.GET)
    public ViewJsonObject getClassAll(){
        //返回数据
        return classesService.getclassAll();
    }
}